package day1107_3;
import java.util.Scanner;

public class number {

    public static void main(String[] args) {
        Scanner in= new Scanner(System.in);
        int number = (int) (Math.random() * 100);
        int a = 0;
        int count = 0;
        System.out.println("猜一个1到100的整数");
        do {
            a = in.nextInt();
            if (number < a) {
                System.out.println("大了");
                count++;
            } else if (number > a) {
                System.out.println("小了");
                count++;
            } else {
                count++;
                break;
            }
        } while (true);
        System.out.println("这个数字是"+number + "您猜的次数是"+count);
    }

}